package gbench.sandbox.matrix;

import org.junit.jupiter.api.Test;
import static gbench.common.tree.LittleTree.*;
import static gbench.common.tree.LittleTree.IRecord.*;
import gbench.commonApp.data.DataMatrixApp;
import static gbench.common.fs.XlsFile.DataMatrix.*;
import static gbench.common.fs.XlsFile.DRow.*;
import static gbench.common.fs.XlsFile.DColumn.*;

@SuppressWarnings("all")
public class JunitDataMatrix extends DataMatrixApp{
    
    @Test
    public void foo() {
        //var mx = cph2(series,"1:3","1:3","1:3","1:3").collect(dmc);
        var mx = cph2(RPTA(4,A(1,0,-1))).collect(dmc);
        println(mx.shape());
        System.out.println(mx.toString(frt(2)));
        var p = mx
            .mapRows( e->e.addElems2("sum",e.sum(),"cnt",e.dblcnt(),"max",e.max()) )
            .mapColumns(e->COL(e.getName(),L(e.sum())))
        ;// 合并列
        System.out.println("----------");
        System.out.println(p);
    }

}
